package org.budo.xml;

import java.io.File;

/**
 * @author lmw
 */
public class 速度测试 {
    public static void main(String[] args) {
        String path = "D:\\eclipse-workspace\\youke-2\\youke-mall\\youke-welfare-service-impl\\src\\main\\resources\\mapper\\OrderInfoAllMapper.xml";

        int j = 10;

        long a = System.currentTimeMillis();

        for (int i = 0; i < j; i++) {
            XmlObject xmlObject = Xml.jdom(new File(path));
            xmlObject.toString();
        }

        long b = System.currentTimeMillis();

        for (int i = 0; i < j; i++) {
            XmlObject xmlObject = Xml.dom4j(new File(path));
            xmlObject.toString();
        }

        long c = System.currentTimeMillis();

        for (int i = 0; i < j; i++) {
            XmlObject xmlObject = Xml.parse(new File(path));
            xmlObject.toString();
        }

        long d = System.currentTimeMillis();

        for (int i = 0; i < j; i++) {
            XmlObject xmlObject = Xml.budo(new File(path));
            xmlObject.toString();
        }

        long e = System.currentTimeMillis();

        System.err.println("共" + j + "次, dom=" + (d - c) + ", dom4j=" + (c - b) + ", jdom=" + (b - a) + ", budo=" + (e - d));
    }
}